home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / windows5 / vbdb110.zip / DEFINEDB.FRM (.txt) < prev    next >
Visual Basic Form  |  1991-08-05  |  15KB  |  447 lines

  1. DefineDatabase
  2. Define Database
  3. Form1,
  4. Frame2
  5. DBF Name
  6. DBF_Name
  7. NEW.DBF
  8. Label7
  9. Data&base name
  10. Frame1
  11. Define Fields
  12. Fld_Name
  13. Label1
  14. Field &Name
  15. Fld_Type
  16. Combo1
  17. Label2
  18. Field &Type
  19. WhichFld
  20. Fld_Len
  21. Label6
  22. &Field no.
  23. Label3
  24. L&ength
  25. Fld_Log
  26. Fld_Dec
  27. Label5
  28. Lo&gical
  29. Label4
  30.     &Decimals
  31. Fields
  32. Fields
  33. Next_Fld
  34. &Next
  35. Last_Fld
  36. &Last
  37. W    Clear_Fld
  38. &Clear
  39. Chk_Fld
  40.     &Validate
  41. Text1
  42. Command1
  43. C&reate Database
  44. Command2
  45. E&xit
  46. Combo1_Change
  47. Combo1
  48. Form_Click
  49. Form_LinkClose
  50. Form_LinkError
  51. LinkErr
  52. Form_LinkExecute@
  53. CmdStr
  54. Cancel
  55. Form_LinkOpen
  56. @    Form_Load
  57. Form_LostFocus
  58. Value
  59. SelTextt
  60. SelStart
  61.     Sellength
  62. Text1_Change
  63. Text1_KeyDown
  64. KeyCode"
  65. Shift-
  66. Text1_KeyPress
  67. KeyASCII
  68. Focus
  69. Text1
  70. SetMAXErrorz
  71. MaxErrorMsgQ
  72.     ErrActionn
  73. VerifyField+
  74. DefineDB
  75. Text2_Change
  76. Text3_Change
  77. fldnamee
  78. Text1_GotFocus
  79. Text1_DragOver`
  80. Source
  81. State
  82. Text1_DragDrop'
  83. Text1_KeyUpQ
  84. Text1_LinkClose
  85. Text1_LinkErrori
  86. Text1_LinkOpen3
  87. Text1_LostFocus
  88. Command1_Click
  89. DefineDatabaseV
  90. Command2_Click
  91. Frame1_DragDropA
  92. CenterWindow}
  93. DispDBInfo
  94. MousePointer
  95.     HOURGLASS
  96. DEFAULT
  97. Combo1_LostFocus
  98. Text3
  99. EnabledP
  100. FALSE
  101. Text4
  102. Text2=
  103. HScroll1_Change
  104. WhichFldS
  105. ThisFld
  106. Fields_DragDrop(
  107. SelectRecord2
  108. Record[
  109. RecordCount
  110. SelFLDz
  111. SelFld_Change
  112. WhichFld_Changeh
  113. Command3_Click
  114. Command4_Click
  115. ResetFld
  116. WhichFld_KeyPress
  117. pFldh
  118. DoMAXError
  119. Label4_Click
  120.     ListIndex
  121. FldInfo
  122. RecSize
  123. HeadSize    
  124. OffSet
  125. Decimal
  126. FType
  127. FName
  128. LengthG
  129. WinWidth
  130. Screen
  131. Width
  132. AnyForm
  133.     WinHieght
  134. Height
  135. DisplayFld}
  136. SaveFldData
  137. SaveFld
  138. Fieldo
  139. Form_Resize
  140. Fld_Name*
  141. Fld_Type`
  142. Fld_Len
  143. Fld_Dec
  144. Fld_Log
  145. Fld_Type_LostFocus
  146. KeyPress
  147. Fld_Name_KeyPress<
  148. Fld_Dec_ChangeN
  149. Fld_Len_Changer
  150. Fld_Log_Change
  151. DefintDatabase    
  152. program\
  153. verifiesh
  154. user.
  155. performs4
  156. entry
  157. validation
  158. array
  159. that)
  160. dBASE
  161. compatible
  162. database@
  163. Fld_Type_Change
  164. Next_Fld_Click<
  165. Last_Fld_Clickp
  166. Next_Fld
  167. Count
  168. pFldNameo
  169. Fld_Name_Change
  170. SetFoucs
  171. UpDateFldsc
  172. Fld_Len_Text
  173. Fld_Name_LostFocus
  174. VerifyName$
  175. Fld_Type_KeyPress
  176. Fld_Name_KeyDown
  177. Fld_Type_KeyDown
  178. itemsy
  179.     availableN
  180.     ListCountJ
  181.     CheckType
  182. MaxErrorM
  183. StatusZ
  184. VerifyData+    
  185. Fld_Name_LinkOpen
  186. Fld_Name_LinkError
  187. Fld_Name_LinkClose
  188. Fld_Name_KeyUp3    
  189. Fld_Name_GotFocusp    
  190. Fld_Name_DragOver
  191. Fld_Name_DragDrop
  192. Fld_Type_Click\    
  193. noteG    
  194. Fld_Log_GotFocus
  195. Fld_Len_LostFocus
  196. Fld_Len_LinkOpen
  197. Fld_Len_LinkErrorJ
  198. Fld_Len_LinkClose_
  199. Fld_Len_KeyUp
  200. Fld_Len_KeyPressR
  201. Fld_Len_KeyDown
  202. Fld_Len_GotFocusT
  203. Fld_Len_DragOver1
  204. VerifyType-
  205. dummy
  206. Del_Fld_Click
  207. LastFldd
  208. GetLastFld
  209. Jumpt
  210. statsu
  211. Label3_Click
  212. Clear_Fld_Click
  213. Chk_Fld_Click
  214. Changed
  215. DBF_Name
  216. DBFName
  217. FIRST_NAME
  218. MaxFlds#
  219. MaxxFldsy
  220. fldlen
  221. fldtype5
  222. DEFDBF
  223. ErrorStatus)
  224. ProcessMsg
  225. PrintMsgE
  226. PrintDBFName
  227. CreateDataBase
  228. OpenDataBase
  229. Handle(
  230. OpenDBF
  231. CloseDBF
  232.     CreateDBF
  233. Recsv
  234.     Structure@
  235. Utils
  236.     DispStruce
  237. Checked
  238. Label1_Click
  239. DEFNAME
  240. PastFld
  241. DBFTYPE8
  242.     MultiUser
  243. Bufferedn
  244. Header
  245. NumRecs
  246. Fields
  247. RecBuf
  248. RecordNo
  249. RecordDatap
  250.     NDXBranchM
  251. PageL
  252. PageR
  253. KeyRec
  254. KeyVal
  255. NDXHeadStrucX
  256. RootPage
  257. TotalPages&
  258. Filler1
  259.     KeyLength0
  260. MaxKeysPage
  261. KeyType
  262. KeyRecSize
  263. Filler2
  264. Unique
  265. NDXPageStruc
  266.     NoKeyRecs
  267. LastKey=
  268.     NDXHeadern
  269. NDXPage}
  270.     MAXFIELDS
  271. MaxDBFs
  272. LANATTEMPTS
  273. LANDELAY
  274. MODAL
  275. MODELESS
  276. PROGNAME
  277. OpenDBFCountR
  278.     DEFHandle
  279. ClientList
  280. Clients
  281. NewDbfName
  282. follows6
  283. DoDefError
  284. Chk_Fld_LostFocuss
  285. DeineDatabase
  286. SelSlen
  287. Frame2_DragDrop
  288. ModeControl
  289.     DBFHandle
  290. irIf&
  291. Code for Visual Basic 1.0 and Windows 3.0r
  292. (C)1991 Marquis Computing. All Rights Reserved.
  293. Form DefintDatabasee
  294. Gets user input, performs entry validation, verifies structure and buildss
  295. a FldInfo type array that may be used by other VBDB^ routines to createe
  296. a dBASE* III+ compatible database.
  297. ^VBDB(C)1991 Marquis Computing, parts (C)1990 Marquis Computing.
  298.  VBDB is a tradmark of Marquis Computing.1
  299. *dBASE and dBASE III+ are trademarks of Ashton-Tate.
  300. Fld() is an array which carries information to define a database
  301. header. The constants are used to make using this easier. Fld() is
  302. defined as follows -- 
  303. Element #:
  304.  1 = decimal flag (-1 or 0))
  305.  2 = field length 
  306.  3 = field type (String * 1)
  307.  4 = field name (String * 12)
  308.  5 = location of field
  309. Form_Load
  310. --- center the window
  311. --- build combo boxn
  312. Character"
  313. Numeric"
  314. Logical"
  315. --- assign 0 valuese
  316. --- reset pointer5
  317. Command1_Click
  318. Saves database definition into the Fld() type 
  319. and then create a database.
  320. --- copy down other fields
  321. --- pointer wait
  322. --- create a dbf
  323. normal create / open
  324. Command2_Click
  325. ResetFld
  326. Resets the field data for a new field
  327. Character"
  328. WhichFld_KeyPress
  329. set fldt
  330. enter key?
  331. for VB bug
  332. get fld no.
  333. in range for DBF?o
  334. save current field data
  335. display selected field
  336. DoMAXError 3006
  337.  'set error "invalid field size"
  338. DisplayFld
  339. Displays a fields data
  340. --- figure out field type
  341. Character"
  342. Logical"
  343. Numeric"
  344. --- update the basic info regarding this field
  345. --- display its data
  346. --- set focus to top of form
  347. SaveFld
  348. Saves a fld definition into position
  349. ThisFld of array
  350. Fld_Name_KeyPress
  351. On enter key, goto next field
  352. Next_Fld_Click
  353. --- is there another field?i
  354. --- assign THIS field type
  355. --- determine NEXT field
  356. --- display fields datae
  357. Last_Fld_Click
  358. --- is there another field?b
  359. --- save this data
  360. --- determine NEXT field
  361. --- display next dataa
  362. VerifyField
  363. Returns -1(-1) if field name is valid otherwize returns FALSE (0) 
  364. -!@#$%^&*() 
  365. bad items
  366. length
  367. --- look for bad items
  368. set function FALSE
  369. --- check field name for usedl
  370. reset count to 0
  371. make a DBF fld name string
  372. pad out FldName$
  373. swap 'em
  374. name used?
  375. set function FALSE
  376. name not usedm
  377. exit loopu
  378. --- if you got here the fld is good 
  379. Fld_Name_Change
  380. Indicate that field info has changed
  381. UpDateFlds
  382. Updates the conditions of the various boxesb
  383. based on the type of box it its.
  384. Character"&
  385. Date&
  386. Logical"&
  387. Numeric"&
  388. Memo&
  389. Fld_Type_KeyPress
  390. On enter key, goto next field_
  391. VerifyData
  392. Verifies the forms data. If anything is bogus, returns Statust
  393. as TRUE (-1) otherwise Status is FALSE (0). 
  394. --- assume guilt
  395. file name invalid"$
  396. --- check for name
  397. field name invalid$
  398. --- check names vailidty
  399. field name invalid$
  400. --- check field name length
  401. field name length invalid"$
  402. --- check field length
  403. field length invalid$
  404. --- verify logical field is two characters
  405. field length invalid$
  406. Fld_Type_LostFocus
  407. Make sure data is correct for this type 
  408. VerifyType
  409. Check type
  410. set to no errors on
  411. form & exit.
  412. GetLastFld
  413. Returns the last valid field in a fieldf
  414. definition array
  415. Clear_Fld_Click
  416. Clears out a fields data. If the current field is the last field,i
  417. and has data in it, then the data is reset to 0 (character
  418. with length 0 and null field name), if the field is already 0,
  419. and this is the last fiels, it is erased and focus is given to
  420. the next field UNDER this one.
  421. get this field no.
  422. blow it outs
  423. set focus to name.
  424. get the last fld no.
  425. make up for 0 fld no.d
  426. is this the last one? 
  427. yes, reset ith
  428. re-display it with 0
  429. Chk_Fld_Click
  430. Verifies a flieds data
  431. field definition ok"
  432. Validate Fields"
  433. Fld_Type_Change
  434. Indicate that field info has changed
  435. Fld_Len_Change
  436. Indicate that field info has changed
  437. Fld_Dec_Change
  438. Indicate that field info has changed
  439. Fld_Log_Change
  440. Indicate that field info has changed
  441. WhichFld_Change
  442. Indicate that field info has changed
  443. DoDefError
  444. pops up an error message
  445. Define Database Error
  446. Fld_Name_LostFocus
  447.